/** @defgroup CONFIG Cargo Configuration
 * @{
 */
/*
 * Application\Inc\config.h
 *
 * Cargo Configuration file
 *
 * Author: Chao-Chi Kuo <chaochi_kuo@systech.com.tw>
 * Copyright (c) 2010 SYSTEMS & TECHNOLOGY CORP. <http://www.systech.com.tw/>
 * All rights reserved.
 *
 * Modifications:
 * 2009/11/18 Chao-Chi Kuo	first implemetation
 *
 * $Id: config.h 250 2010-11-04 07:08:28Z joseph_hsu $
 */

#ifndef __CONFIG_H_
#define __CONFIG_H_

#ifdef  __cplusplus
extern "C" {
#endif		/* __cplusplus */


/** @name System Configuration
 * @{
 */
#define HSE_CLK		16000000UL	///<HSE:16MHz


#define SYS_CLK_48M	48000000UL	///<SYSCLK: 48MHz
#define SYS_CLK_24M	24000000UL

#define SYS_CLK		SYS_CLK_24M

#define SYS_TICK	10			///<SYSTEM TICK: 10ms	??or 1ms ??





#define OS_10MS		(10)
#define OS_100MS	(100)
#define OS_1SEC		(1000)

/** @} */

//========== Version =====================================
//v2.00 Support SMS TEST
//v3.00 support RI Call and send out sms
//v3.10_B01 modify Delay for new Task and Use QBuf for Modem process to String
//Release:V4.00_Beta00 2012/08/08 , Modify:support GSM debug and AGPS (need test)
//========================================================
#define FW_VERSION			"4.00"			
#define FW_REVISED			"Beta00"		
#define BRAND_NAME			"BX1\0"

#define HW_VERSION			"E-compass_TEST\0"
#define PROTOCOL_VERSION	"BX1 0.00\0"
#define GPS_MODULE_UBLOX	"U-BLOX\0"
#define GPS_MODULE_SIRF		"SIRF\0"

#define USING_OLD_PROTOCOL	1


/** @name Mode configuration
 * @{
 */
#define DEBUG_MODE		1		///< debug mode
#define PCB_REV_A		1
#define PCB_REV_B		0
#define PCB_REV_C		0

/** @} */



/** @name Task Configuration
 * @{
 */
#define SUPER_TASK_NUM		2	///< max number of supertask
#define TASK_NUM			50	///< max number of task			//freeze 20101108 for 30 ==> 40
/** @} */

#define LOW_BAT_VOLTAGE		3620	///< 3650 mV
#define WORK_BAT_VOLTAGE	3650	///< 3850 mV

/** @name GPS Configuration
 * @{
 */
#define GPS_RX_BUF_SIZE	128		///< GPS RX buffer size
#define NMEA_BUF_SIZE	96		///< NMEA code buffer size

#define GPS_SIRF		1		///<< SIRF
#define GPS_UBLOX		2		///<< UBLOX

/** @} */

/** @name SPI FLASH configuration
 * @{
 */
#define M25P16_ID	0x208015	///<M25P64 ID
#define FLASH_ID	M25P16_ID
/** @} */

/** @name Console configuration
 * @{
 */
#define UART_BAUDRATE	57600

#define USING_UART		0		///< h/w using uart
#define USING_VCP		1		///< h/w using virtual com port
/** @} */

/** @name GSM configuration
 * @{
 */
#define SIM340DZ		1
#define GE864_QUAD		0

#define FLOW_CTRL		1

/** @} */


/** @name IRQ group 0 Priority configuration
 * @{
 */
#define IRQ_USART3		2
#define IRQ_USART2		3
#define IRQ_USART1		1
#define IRQ_USB_LP		1
#define IRQ_EXTI_0		6
#define IRQ_EXTI_4		7
#define IRQ_EXTI_9_5	7
#define IRQ_EXTI_15_10	7
#define IRQ_SPI1		8
#define IRQ_SYSTICK		9
#define IRQ_RTC			10
#define IRQ_RTC_ALARM	11
  
#define IRQ_UART4       4
#define IRQ_UART5       5
  
/** @} */

#define UTC_20100101	0x4B3D3B00

#define AD_RESOLUTION       4096
#define VOLTAGE_UNIT        1000
#define VOLTAGE_REF         3.4


#ifdef __cplusplus
}
#endif	/* __cplusplus */
#endif	/* __CONFIG_H_ */
/** @} */